pygrub: if default entry is "saved" then use first entry.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 23 Nov 2009 07:17:10 +0000 (07:17 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 23 Nov 2009 07:17:10 +0000 (07:17 +0000)
pygrub doesn't support the "savedefault" command and will error out if
menu.lst uses the "default saved" directive. We might as well start on
the first entry in this case instead of failing.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
tools/pygrub/src/GrubConf.py

index cfd75dbc481d1b2055dd0ee63778af4ce75ff760..694f5d5dd2cc2ffed679e7d7c90ebac37ed8e835 100644 (file)
@@ -258,7 +258,7 @@ class GrubConfigFile(object):
         return self._default
     def _set_default(self, val):
         if val == "saved":
-            self._default = -1
+            self._default = 0
         else:
             self._default = int(val)